Definition
An SPSS macro is a function defined by the user in order to automate some task(s).
SPSS Macro Syntax
- As discussed earlier, Python uses program blocks that start with
BEGIN PROGRAM.
and end withEND PROGRAM.
. - A different kind of program block may start with
DEFINE
and end with!ENDDEFINE.
. Between these commands you'll find code that looks a lot like basic SPSS syntax with a lot of exclamation marks. Such a function is called a macro.
SPSS Macros Versus Python
- Since the introduction of Python for SPSS, macros may safely be considered deprecated.
- Everything that can be done with a macro (and way more than that) can be done with Python as well.
- On top of that, Python code is usually much shorter and more readable than the same task in macro language.
THIS TUTORIAL HAS 2 COMMENTS:
By Isabel on February 21st, 2016
Really helpful site. Re Python, if we download all the necessities thru IBM SPSS, when we run Python programming are we on-line? I have data that I can't run thru the internet.
By Ruben Geert van den Berg on February 21st, 2016
Hi Isabel! The answer is no: after installing everything, SPSS as well as Python will both run from your local hard disk. You don't need any internet connection whatsoever after everything's been installed.